package com.soft.controller;

import com.soft.pojo.Left;
import com.soft.service.LeaveEmpService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ruoxi
 * @create 2021-12-29 8:48
 */
@WebServlet("/leaveCheckInfo")
public class LeaveCheckInfoServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int id = Integer.parseInt(req.getParameter("id"));

        LeaveEmpService leaveEmpService = new LeaveEmpService();
        Left leaveEmp = leaveEmpService.findLeaveEmpById(id);

        req.setAttribute("leaveEmp", leaveEmp);
        req.getRequestDispatcher("leaveCheckInfo.jsp").forward(req,resp);
    }
}
